/* 
This javascript file is for connecting the database to the main file
and pleace the data accoding to the respective fields and mention the database type
for this we need to be carefull because if we dont comunicate with database properly we are not going to
get any of grid view work.
 */
$(document).ready(function(){
    $("#list").jqGrid({
        url:'mysqldata.php',
        mtype:'GET',
        datatype:"json", //for now i have changed jsonstring to json to work on some application.
        colNames:['Id','User','Password'],
        colModel:[
            {name:'id',width:30,index:'id',resizable:true,sorttype:'int', editrules:{readOnly:true}},
            {name:'user',width:90,index:'user',editable:true, resizable:true,edittype:"text",editoption:{size:30,maxlength:50}, editrules:{required:true}},
            {name:'password',width:100,index:'password',editable:true,resizable:true,edittype:"text",editoption:{size:30,maxlength:50},editrules:{required:true}}
            
        ],
        rowNum:10,
        rowList:[5,10,20,30],
        pager:'#pager',
        sortname:'id',
        sortorder:'desc',
        viewrecords:true,
        width:450,
        
        editurl:'AddEdit.php',

        imgpath:'jqGrid/themes/steel/images',
        caption:'my first grid'
    });
    $("#list").navGrid("#pager",{add:true,del:true,edit:true,view:false,search:true});
//    $("#list").navGrid('#pager',{
   //         edit:true, add:true, del:true, view:false, search:false
    //    ,position:"right"});
})

